﻿/*
 * =====================================================================================
 *
 *       Filename:  ErrerManagerTools.cs
 *
 *    Description:  
 *
 *        Version:  1.3
 *        Created:  
 *       Revision:  none
 *       Compiler:  
 *
 *         Author:  imbedinlove@gmail.com
 *        Company:  2013年4月17日 11:27:16
 *
 * =====================================================================================

 */
using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.IO;

namespace WebSiteTools
{
    public class ErrorMessageTools
    {
        /// <summary>
        /// 异常记录
        /// </summary>
        /// <param name="from">异常来自</param>
        /// <param name="message">异常信息</param>
        /// <returns>记录信息</returns>
        public static string logErr(Exception ex)
        {
            ImbedLibrary.Logs.Err("Form: " + ex.InnerException.Source + "\r\nMessage: " + ex.InnerException.Message);
            String t = "error>m:来源：{0},消息：{1}(来自服务器)";
            string mes = t.Replace("{0}", ex.InnerException.Source);
            mes = mes.Replace("{1}", ex.InnerException.Message);
            Console.WriteLine(mes);
            return t;
        }
    }
}
